home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 1
/
SPACE - Library 1 - Volume 1.iso
/
program
/
356
/
defs
/
inout.def
< prev
next >
Wrap
Text File
|
1992-03-11
|
3KB
|
100 lines
DEFINITION MODULE InOut; (*$T- N.Wirth 27.2.80*)
(* modified by Philip E. Rosine
17 nov 83
modification was done to make this module
compatible with the definition for InOut
given in [Wirth,1983]. *)
(* History of modifcation *)
(* *)
(* Who Date Why *)
(* K.Y. Tan. 6/18/85 To work with DBROS library *)
(* Morris 9/19/86 Add termCH, make EOL a constant *)
(* Morris 9/19/86 Make Read and ReadString work
N. Wirth book *)
(* Morris 10/3/86 Change Open(Input,Output) to take
extention file name *)
(*
* Copyright (c) 1985, 1986 by
* Djavaheri Bros., Foster City, California.
* All Rights Reserved.
*
* This software is furnished under a license and may be used and copied
* only in accordance with the terms of such license and with the
* inclusion of the above copyright notice. This software or any other
* copies thereof may not be provided or otherwise made available to any
* other person. No title to and ownership of the software is herby
* transferred.
*
* The information in this software is subject to change without notice
* and should not be construed as a commitment by Djavaheri Bros. No
* warranty is implied or expressed.
*
* SCCID = "1.2 10/8/86";
*)
FROM Files IMPORT File;
FROM SYSTEMX IMPORT EofLineChar;
EXPORT QUALIFIED
OpenInput, OpenOutput, CloseInput, CloseOutput, Read,
ReadLn, ReadString, ReadInt, ReadCard, Write,
WriteLn, WriteString, WriteInt, WriteCard, WriteOct,
WriteHex, EOL, EOF, Done, termCH,
STDInput,STDOutput;
CONST
EOL = EofLineChar;
VAR
Done : BOOLEAN;
termCH : CHAR;
STDInput , STDOutput : File;
PROCEDURE OpenInput(VAR defext : ARRAY OF CHAR);
(* this routine is the same as the routine SetInput of
module StandIO, which sets the standrad input file as
specified by defext name after is opened *)
PROCEDURE OpenOutput(VAR defext : ARRAY OF CHAR);
(* this routine is the same as the routine SetOutput of
module StandIO, which sets the standrad output file as
specified by defext name after is opened *)
PROCEDURE CloseInput;
(* closes input file; returns input to terminal *)
PROCEDURE CloseOutput;
(* closes output file; returns output to terminal *)
PROCEDURE Read(VAR ch: CHAR);
PROCEDURE ReadLn;
PROCEDURE ReadString(VAR s:ARRAY OF CHAR);
PROCEDURE ReadInt(VAR x: INTEGER);
PROCEDURE ReadCard(VAR x: CARDINAL);
PROCEDURE Write(ch: CHAR);
PROCEDURE WriteLn;
PROCEDURE WriteString(VAR s: ARRAY OF CHAR);
PROCEDURE WriteInt(x,n: INTEGER);
PROCEDURE WriteCard(x, n: CARDINAL);
PROCEDURE WriteOct(w, n: CARDINAL);
PROCEDURE WriteHex(w, n: CARDINAL);
PROCEDURE EOF () : BOOLEAN;
(* check End_Of_File *)
END InOut.